<template>
  <div class="link">
    <div class="title">友链</div>
    <el-row :gutter="15">
      <el-col :md="{span:8}" :sm="{span:12}" v-for="(item,index) in linkLis" :key="index">
        <a target="_blank" :href="item.url" class="link-item">
         <div class="avatar">
           <img :src="item.avatar" alt="">
         </div>
         <div class="name">
           {{ item.name }}
         </div>
         <div class="desc">
          {{ item.desc }}
         </div>
         <!-- 这里也可以用伪元素 -->
         <span class="lt"></span>
         <span class="lb"></span>
         <span class="rt"></span>
         <span class="rb"></span>
        </a>
      </el-col>
    </el-row>
  </div>
</template>

<script>
  export default {
    name: 'linkpage',
    data(){
      return {
        linkLis: [
          {
            avatar: '/images/avatar-02.jpg',
            name: '蓝桥的女人',
            url: 'http://www.supert.net.cn/',
            desc: '我爱上了你，你却抛弃了我，可怜！'
          },
          {
            avatar: '/images/avatar-03.jpg',
            name: '蓝桥的女人',
            url: 'http://www.supert.net.cn/',
            desc: '我爱上了你，你却抛弃了我，可怜！我爱上了你，你却抛弃了我，可怜！我爱上了你，你却抛弃了我，可怜！'
          },
          {
            avatar: '/images/avatar-04.jpg',
            name: '蓝桥的女人',
            url: 'http://www.supert.net.cn/',
            desc: '我爱上了你，你却抛弃了我，可怜！'
          },
          {
            avatar: '/images/avatar-06.jpg',
            name: '蓝桥的女人',
            url: 'http://www.supert.net.cn/',
            desc: '我爱上了你，你却抛弃了我，可怜！'
          },

        ]
      }
    }
  }
</script>

<style lang="scss" scoped>
.link{
  @include panel;
  min-height: 100vh;
  transition: transform 0.25s;
  >.title{
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    padding-bottom: 30px;
  }
  .link-item{
    text-align: center;
    display: block;
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
    .avatar{
      width: 45px;
      height: 45px;
      border-radius: 50%;
      overflow: hidden;
      margin: 0 auto;
      img{
        width: 100%;
        height: 100%;
      }
    }
    .name{
      font-size: 12px;
      padding-top: 5px;
      padding-bottom: 5px;
    }
    .desc{
      @include sliptText;
      font-size: 12px;
      padding-top: 10px;
    }
    .lt,.lb,.rt,.rb{
      position: absolute;
      width: 5px;
      height: 5px;
      border: 2px solid transparent;
      transition: border-color 0.25s;
    }
    .lt{ left: 0; top: 0;border-right: none;border-bottom: none;}
    .lb{left: 0;bottom: 0;border-top: none;border-right: none;}
    .rt{right: 0;top: 0;border-left: none;border-bottom: none;}
    .rb{right: 0;bottom: 0;border-left: none;border-top: none;}
    &:hover{
      transform: scale(1.025);
      .lt,.lb,.rt,.rb{
        border-color: $primary-color;
      }
    }
  }
}
</style>
